package com.qidian.tcba.admin.api.controller;


import com.qidian.tcba.admin.model.dto.parkLot.ParkLotInfoDTO;
import com.qidian.tcba.admin.service.ParkLotRecordTaskLastChangeService;
import com.qidian.tcba.utils.result.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 停车场备案任务上一次提交备份表 前端控制器
 * </p>
 *
 * @author 冯永龙
 * @since 2021-07-06
 */
@RestController
@RequestMapping("/parkLotRecordTaskLastChange")
@Api(tags = "上一次提交备份")
public class ParkLotRecordTaskLastChangeController {
    @Autowired
    private ParkLotRecordTaskLastChangeService parkLotRecordTaskLastChangeService;

    @ApiOperation("获取上一次提交备份")
    @GetMapping("/getLastChange/{id}")
    public JsonResult getLastChange(@PathVariable("id")int id){
        Map<String, ParkLotInfoDTO> taskLastChange = parkLotRecordTaskLastChangeService.getTaskLastChange(id);
        return JsonResult.success().data(taskLastChange);
    }
}

